package com.imc.platform.base.home.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.imc.api.order.pojo.Lesson;
import com.imc.platform.base.banner.pojo.Banner;
import com.imc.platform.base.banner.pojo.BannerItem;
import com.imc.platform.base.home.dao.IHomeMapper;
import com.imc.platform.base.home.service.IHomeService;
import com.imc.platform.base.notice.dao.INoticeMapper;
import com.imc.platform.base.notice.pojo.Notice;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/*
*类描述：banner业务类
*开发者：sjc
*创建时间：2018-8-3 14:57:32
*/
@Service
public class HomeServiceImpl implements IHomeService {

    @Autowired
    IHomeMapper iHomeMapper;
    @Autowired
    INoticeMapper noticeMapper;

    /**
     * 方法描述:
     * SJC 2018-9-17 20:03:58
     *
     */
    @Override
    public List<Map<String,Object>> querySendMsg(String userId){
        return iHomeMapper.querySendMsg(userId);
    }

    /**
     * 方法描述:
     * SJC 2018-9-17 20:03:58
     *
     */
    @Override
    public List<Map<String,Object>> queryReceivedMsg(String userId){
        return iHomeMapper.queryReceivedMsg(userId);
    }

    /*
     * YT  2018/10/27 22:13
     * 方法描述：通过用户ID查询接收的消息数
     */
    @Override
    public String queryReceivedMsgCount(String userId){
        return iHomeMapper.queryReceivedMsgCount(userId);
    }

    /*
     * YT  2018/10/27 22:14
     * 方法描述：通过用户ID查询发送的消息数
     */
    @Override
    public String querySendMsgCount(String userId){
        return iHomeMapper.querySendMsgCount(userId);
    }

    /*
     * YT  2018/10/27 22:16
     * 方法描述：首页查询课程
     */
    @Override
    public List<Notice> queryNewsByHome() {
        return noticeMapper.queryNewsByHome();
    }

    /*
     * YT  2018/10/27 22:16
     * 方法描述：首页查询课程
     */
    @Override
    public List<Lesson> queryLessonByHome() {
        return null;
    }

    /*
     * YT  2018/10/27 22:16
     * 方法描述：通过标题首页查询公告
     */
    @Override
    public List<Notice> queryNoticeByHomeByTitle(String title) {
        return noticeMapper.queryNoticeByHomeByTitle(title);
    }
}
